<template>
  <a-form :model="searchParams" layout="inline">
    <a-form-item field="title" label="标题" style="min-width: 240px">
      <a-input v-model="searchParams.title" placeholder="请输入标题" />
    </a-form-item>
    <a-form-item field="tags" label="标签" style="min-width: 240px">
      <a-input-tag v-model="searchParams.tags" placeholder="请输入标签" />
    </a-form-item>
    <a-form-item>
      <a-button type="primary" @click="doSubmit">提交</a-button>
    </a-form-item>
  </a-form>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { QuestionQueryRequest } from "../../../generated";

const searchParams = ref<QuestionQueryRequest>({
  title: "",
  tags: [],
  pageSize: 8,
  current: 1,
});

const doSubmit = () => {
  // 这里需要重置搜索页号
  searchParams.value = {
    ...searchParams.value,
    current: 1,
  };
};
</script>

<style scoped></style>
